package com.yunji.storage.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunji.common.annotation.Excel;
import com.yunji.common.base.BaseDelFlagDO;
import com.yunji.common.base.IEventJbpm;
import com.yunji.storage.enums.AllocateStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.domain
 * @Title: allocateTicket
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-20 14:39:31      V1.0        HuaAo       新建类
 */
@TableName("v3_allocate_ticket")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AllocateTicketDO extends BaseDelFlagDO implements Serializable, IEventJbpm {

    private static final long serialVersionUID = -712341389647724929L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("调拨ID")
    private Long allocateId;

    @ApiModelProperty("调拨单号")
    @Excel(name = "调拨单号", width = 15)
    private String allocateCode;

    @ApiModelProperty("所属单位ID")
    private Long belongId;

    @ApiModelProperty("调出单位ID")
    private Long outBelongId;

    @ApiModelProperty("调入单位ID")
    private Long intoBelongId;

    @ApiModelProperty("调拨状态 0-草稿 1-待出库 2-待收货 3-已完成 4-已取消 5-作废")
    @Excel(name = "调拨状态 0-草稿 1-待出库 2-待收货 3-已完成 4-已取消 5-作废", width = 15)
    private Integer allocateStatus;

    @ApiModelProperty("调拨备注")
    @Excel(name = "调拨备注", width = 15)
    private String remark;

    @ApiModelProperty("提交时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "提交时间", width = 15)
    private Date applyTime;

    @ApiModelProperty("备注信息")
    @Excel(name = "备注信息", width = 15)
    private String remarks;

    @Override
    public Long getId() {
        return this.getAllocateId();
    }

    @Override
    public Integer getNewStatus() {
        return this.getAllocateStatus();
    }

    @Override
    public Integer getEventType() {
        return 0;
    }

    @Override
    public String getNewStatusName() {
        return AllocateStatus.get(this.allocateStatus);
    }
}